*
* $Id$
*
* $Log: gbrelm.F,v $
* Revision 1.1.1.1  2002/07/24 15:56:25  rdm
* initial import into CVS
*
* Revision 1.1.1.1  2002/06/16 15:18:40  hristov
* Separate distribution  of Geant3
*
* Revision 1.1.1.1  1999/05/18 15:55:20  fca
* AliRoot sources
*
* Revision 1.1.1.1  1995/10/24 10:21:22  cernlib
* Geant
*
*
#include "geant321/pilot.h"
*CMZ :  3.21/02 29/03/94  15.41.21  by  S.Giani
*-- Author :
      FUNCTION G3BRELM(Z,T,BCUT)
C.
C.    ******************************************************************
C.    *                                                                *
C.    *  To calculate energy loss due to soft muon BREMSSTRAHLUNG.     *
C.    *                                                                *
C.    *    ==>Called by : G3BRELA                                      *
C.    *       Author  L.Urban  *********                               *
C.    *                                                                *
C.    ******************************************************************
C.
#include "geant321/gconsp.inc"
      DIMENSION C(52),D(28)
      DATA C/0.615548E-07,-0.858333E-07, 0.148015E-06,-0.220289E-07
     +      , 0.162987E-08,-0.305945E-10, 0.170957E-06,-0.272156E-06
     +      , 0.610418E-07,-0.768052E-08, 0.391729E-09,-0.104624E-10
     +      , 0.412993E-07,-0.373362E-08,-0.110920E-08, 0.571124E-09
     +      ,-0.477538E-10, 0.169448E-11, 0.323774E-08,-0.305497E-08
     +      , 0.758138E-09,-0.121885E-09, 0.857707E-11,-0.253742E-12
     +      , 0.133703E-08,-0.676756E-09, 0.147782E-09,-0.136039E-10
     +      , 0.556182E-12,-0.634277E-14, 0.847418E-10,-0.288608E-10
     +      , 0.224661E-11, 0.514422E-13,-0.122288E-13, 0.333673E-15
     +      ,-0.153886E-08, 0.100179E-08,-0.149457E-09, 0.734506E-11
     +      ,-0.507324E-09, 0.146362E-09,-0.126608E-10, 0.778818E-13
     +      ,-0.161333E-10,-0.199252E-11, 0.100270E-11,-0.347404E-13
     +      ,-0.465077E-11, 0.121078E-11,-0.131113E-12, 0.431515E-14/
      DATA D/-0.389616E-05,-0.130106E-09, 0.101380E-04, 0.259032E-07
     +      ,-0.816804E-07,-0.961867E-05,-0.603907E-08, 0.192015E-07
     +      , 0.772670E-08, 0.459337E-05, 0.761272E-09,-0.251956E-08
     +      , 0.483037E-10,-0.289802E-08,-0.117497E-05,-0.484372E-10
     +      , 0.155476E-09,-0.218604E-10, 0.812047E-10, 0.380265E-09
     +      , 0.154338E-06, 0.118357E-11,-0.367778E-11, 0.119199E-11
     +      ,-0.273719E-11,-0.201239E-11,-0.221931E-10,-0.818793E-08/
C
      DATA AKSI,BETA,DEL/2.20,1.24,0.58/
C
      DATA CONMX/0.130653/
C        CONMX=0.75*SQRT(2.7182...)*EMMU
C.
C.    ------------------------------------------------------------------
C.
      G3BRELM=0.
      IF(BCUT.LE.0.) GOTO 99
C
      Z3=Z**0.333333
      E=T+EMMU
      ECMAX=E-CONMX*Z3
      X=LOG(E/EMMU)
      IF(BCUT.GE.ECMAX) GOTO 60
C
      Y=LOG(BCUT/EMMU)
      S=0.
      YY=1.
      DO 30 I=1,6
         XX=1.
         DO 20 J=1,6
            K=6*I+J-6
            S=S+C(K)*XX*YY
            XX=XX*X
  20     CONTINUE
         YY=YY*Y
  30  CONTINUE
      SS=0.
      YY=1.
      DO 50 I=1,4
         XX=1.
         DO 40 J=1,4
            K=4*I+J+32
            SS=SS+C(K)*XX*YY
            XX=XX*X
  40     CONTINUE
         YY=YY*Y
  50  CONTINUE
      S=S+Z*SS
      IF(S.LE.0.) GOTO 99
C
      FAC=E*(BCUT/E)**BETA
      FAC=Z*(Z+AKSI*(1.+DEL*LOG(Z)))*FAC
      G3BRELM=FAC*S
      GOTO 99
C
  60  Y=Z3
      S=D(1)
      K=1
      XX=1.
      YPX=Y/X
      DO 80 I=1,6
         II=I+1
         XX=XX*X
         XXYY=XX
         DO 70 J=1,II
            K=K+1
            S=S+D(K)*XXYY
            XXYY=XXYY*YPX
  70     CONTINUE
  80  CONTINUE
      IF(S.LE.0.) GOTO 99
C
      FAC=Z*(Z+1.)*ECMAX
      IF(FAC.LE.0.) GOTO 99
      G3BRELM=FAC*S
C
  99  RETURN
      END
